package com.rockcent.mall.lib.domain;

import com.rockcent.common.domain.IDEntityMall;
import com.rockcent.common.domain.enumclass.Whether;
import com.rockcent.mall.lib.domain.enumclass.CashCouponStatus;
import com.rockcent.mall.lib.domain.enumclass.MallMemberStatus;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 会员账号
 * Created by zhangjh on 2017/03/07.
 */
@Entity
@Table(name = "mall_member")
@DynamicInsert(value = true)
@DynamicUpdate(value = true)
public class MallMember extends IDEntityMall {

    /**
     * 平台ID
     */
    @Column(columnDefinition = "bigint(20) comment '平台ID'")
    private Long mallId;

    /**
     *账户余额
     */
    @Column(columnDefinition = "DECIMAL(30,10) comment '账户余额'")
    private BigDecimal balance;

    /**
     * 试用开始时间
     */
    @Column(columnDefinition = "datetime comment '有效期开始时间'")
    private Date dateEnabled;

    /**
     * 试用结束时间
     */
    @Column(columnDefinition = "datetime comment '有效期结束时间'")
    private Date dateDisabled;

    /**
     * 累计试用天数
     */
    @Column(columnDefinition = "long comment '累计试用天数'")
    private Long probationaryPeriodDays;

    /**
     * 平台会员状态
     */
    @Column(columnDefinition = "varchar(30) comment '平台会员状态 NOT_MEMBER(\"未认证\"), PROBATION_MEMBER(\"试用期会员\"), AUDITING(\"开通审核中\"), AUDIT_REFUSE(\"开通失败\"), MEMBER(\"已开通\")'")
    @Enumerated(EnumType.STRING)
    private MallMemberStatus status;

    /**
     * 备注
     */
    @Column(columnDefinition = "varchar(30)  comment '备注'")
    private String remark;


    /**
     * 生效时间
     */
    @Column(columnDefinition = "datetime  comment '生效时间，成为平台会员的时间'")
    private Date effectDate;


    /**
     * 结算日
     */
    @Column(columnDefinition = "varchar(30)  comment '结算日'")
    private String settlementDate;



    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }
    public Long getMallId() {
        return mallId;
    }

    public void setMallId(Long mallId) {
        this.mallId = mallId;
    }

    public BigDecimal getBalance() {
        return balance;
    }

    public void setBalance(BigDecimal balance) {
        this.balance = balance;
    }

    public Date getDateEnabled() {
        return dateEnabled;
    }

    public void setDateEnabled(Date dateEnabled) {
        this.dateEnabled = dateEnabled;
    }

    public Date getDateDisabled() {
        return dateDisabled;
    }

    public void setDateDisabled(Date dateDisabled) {
        this.dateDisabled = dateDisabled;
    }

    public Long getProbationaryPeriodDays() {
        return probationaryPeriodDays;
    }

    public void setProbationaryPeriodDays(Long probationaryPeriodDays) {
        this.probationaryPeriodDays = probationaryPeriodDays;
    }

    public MallMemberStatus getStatus() {
        return status;
    }

    public void setStatus(MallMemberStatus status) {
        this.status = status;
    }

    public Date getEffectDate() {
        return effectDate;
    }

    public void setEffectDate(Date effectDate) {
        this.effectDate = effectDate;
    }

    public String getSettlementDate() {
        return settlementDate;
    }

    public void setSettlementDate(String settlementDate) {
        this.settlementDate = settlementDate;
    }

    @Override
    public String toString() {
        return "MallMember{" +
                "mallId=" + mallId +
                ", balance=" + balance +
                ", dateEnabled=" + dateEnabled +
                ", dateDisabled=" + dateDisabled +
                ", probationaryPeriodDays=" + probationaryPeriodDays +
                ", status=" + status +
                ", remark='" + remark + '\'' +
                ", effectDate=" + effectDate +
                ", settlementDate='" + settlementDate + '\'' +
                '}';
    }
}
